<input type="hidden" id="vslai_rewrite_model" value="{:rewrite_model()}">
<input type="hidden" id="vslai_url_model" value="{:url_model()}">
<script>
function __URL(url)
{
    url = url.replace('SHOP_MAIN', '');
    url = url.replace('APP_MAIN', 'wap');
    if(url == ''|| url == null){
        return 'SHOP_MAIN';
    }else{
        var str=url.substring(0, 1);
        if(str=='/' || str=="\\"){
            url=url.substring(1, url.length);
        }
//        return url;
//         if($("#vslai_rewrite_model").val()==1 || $("#vslai_rewrite_model").val()==true){
//             return 'SHOP_MAIN/'+url;
//         }
        var action_array = url.split('?');
        //检测是否是pathinfo模式
        var url_model = $("#vslai_url_model").val();
        if(url_model==1 || url_model==true)
        {
            var base_url = 'SHOP_MAIN/'+action_array[0];
            var tag = '?';
        }else{
            var base_url = 'SHOP_MAIN?s=/'+ action_array[0];
            var tag = '&';
        }
        if(action_array[1] != '' && action_array[1] != null){
            return base_url + tag + action_array[1];
        }else{
        	 return base_url + tag;
        }
    }
}
//处理图片路径
function __IMG(img_path){
    var path = "";
    if(img_path != undefined && img_path != ""){
        if(img_path.indexOf("http://") == -1 && img_path.indexOf("https://") == -1){
            if(img_path.substr(0,1)=='/'){
                path = UPLOAD+img_path;
            }else{
                path = UPLOAD+"\/"+img_path;
            }
        }else{
            path = img_path;
        }
    }
    return path;
}
</script>